package com.boot.modules.core.controller;

import com.boot.common.anno.AnnoLog;
import com.boot.common.result.Result;
import com.boot.modules.core.service.CoreService;
import com.boot.system.service.ModuleService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RequiredArgsConstructor
@RestController
@RequestMapping("/core")
public class CoreController {

    private final CoreService coreService;

    private final ModuleService moduleService;

    @AnnoLog(value = "列表查询")
    @PostMapping("/list")
    public Result<?> coreList(@RequestHeader("Mid") String mid, @RequestBody Map<String, Object> queryParam) {
        return Result.success(coreService.getCorePage(moduleService.getCache(mid), queryParam));
    }

}
